package com.ww.scala.syntax

/**
 * 偏函数
 */
object syntax07_partialFunction {

  def main(args: Array[String]): Unit = {
    def xxx: PartialFunction[Any, String] = {
      case "hello" => "hello"
      case 4 => "4"
      case _ => "none"
    }

    println(xxx(4))
    println(xxx("hello"))
    println(xxx("sss"))
  }


}


